-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multi-sources: Add agent data model and endpoint definition for multi sources #41
Conversation
api/v1alpha1/agent/openapi.yaml
Outdated
@@ -53,6 +53,42 @@ paths: | |||
application/json: | |||
schema: | |||
$ref: '../openapi.yaml#/components/schemas/Error' | |||
/api/v1/agents/{id}: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be /api/v1/agents/{id}/status
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it can be. I wrote it like this cause we don't have another put operation on the agent.
I'll change it
0045487
to
6cb6fb0
Compare
a3479c4
to
c07847d
Compare
This commit adds the data model for agent resource. The source model has been modified by adding a many2one relationship to the agent. A new endpoint `/api/v1/agents` has been added but not implemented. Signed-off-by: Cosmin Tupangiu <[email protected]>
type: object | ||
properties: | ||
id: | ||
type: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nirarg Here we would like to have the version in the future.
@@ -21,6 +21,7 @@ type Source struct { | |||
SshKey string | |||
Inventory *JSONField[api.Inventory] `gorm:"type:jsonb"` | |||
CredUrl *string | |||
Agents []Agent `gorm:"constraint:OnDelete:SET NULL;"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is now the relation between agents statuses and source status?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good question. At this stage, the list of source statuses is the same with the agent's. Definitely, we should improve that.
@@ -21,6 +21,7 @@ type Source struct { | |||
SshKey string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We we want to move the sshkey out of here. Or will that be done in followup PRs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
follow up
This commit adds the data model and store implementation for agent resource. The source model has been modified by adding a many2one relationship to the agent.
A new endpoint
/api/v1/agents
has been defined but not implemented.There are no breaking changes in the current implementation.
Solves: ECOPROJECT-2271
Signed-off-by: Cosmin Tupangiu [email protected]